#ifndef XCAMERA
#define XCAMERA
#include "../XModEngine/XObject.h"
#include "../XModEngine/Matrix.h"
#include "../XModEngine/XRender.h"
#include "../XModEngine/XComponent.h"
#include "COMInclude.h"
class XC_ENTRY XCamera : public XObject,IXMoveble
{
private:
	Vector3 v_right;
	Vector3 v_up;
	Vector3 v_look;
	Vector3 v_pos;
	Vector3 v_target;
	Matrix4 mat_Projection;
	Matrix4 mat_View;
	Matrix4 mat_ViewProjection;
	bool b_inUse;
	static XCamera* ptr_camera_used;

	void CalcViewMatrix();
	void CalcProjMatrix();
public:
	float f_fov, f_near, f_far;
	XCamera();
	~XCamera();
	bool Init();
	void CalcViewPort();
	void SetViewPort();
	void Update();
	string ToString();
	void OpenEyes();
	void CloseEyes();
	void SetView(Matrix4 mat_view);
	void SetProj(Matrix4 mat_proj);
	void MoveUp(float f_unit);
	void MoveFoward(float f_unit);
	void MoveRight(float f_unit);
	void Roll(float f_angle);
	void Yaw(float f_angle);
	void Pitch(float f_angle);
	void SetCameraPos(const Vector3 v_pos);
	void SetCameraPos(float f_x, float f_y, float f_z);
	void SetTarget(const Vector3 v_target);
	void SetTarget(float f_x, float f_y, float f_z);
	void SetRender(XRender* render);
	void RotationAxis(Vector3 axis, float angle);
	void RotationTarget(float angle);
};
#endif

